<?php
	include "../head.php"
	// SESSION_START()
?>
<head>
	<meta charset="utf-8">
	<title>YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证</title>
	<link rel="stylesheet" type="text/css" href="xiangqing.css">
</head>
	<body>
		<div id="banner">
			<img src="headerffniojwo141fdver.JPG">
		</div>
		<div id="xz1">
			<font><a href="">YOHO首页</a> > 上衣 > T恤 > 5CM 人像印花T恤</font>
		</div>
		<div id="face">
			<?php
				//1 导入配置文件 
				include("../../../public/dbconfig.php");
				//2 连接数据库
				$link = @mysqli_connect(HOST,USER,PASS) or die("数据库连接失败");
				//3 选择数据库 设置字符集
				mysqli_set_charset($link,"utf8");
				mysqli_select_db($link,DBNAME);
				//where 使用昨天的封装搜索条件
				//4 设置数组来接收搜索的条件 
				$wherelist = array();
								
				//5 判断get方式传值 搜索条件是否存在
				if(!empty($_GET['id'])){
					//$wherelist[] = "id in(select id from goods where goods like '%,{$_GET['id']},%')";
					$wherelist[] = "id={$_GET['id']}";
				}
				// var_dump($wherelist);die;
				//6 查看搜索条件数组是否有值 
				if(count($wherelist)>0){
					$where  = " where ".implode(" and ",$wherelist);
				}
				// var_dump($where);die;
				//7 拼接sql/语句
				$sql = "select * from goods ".$where;
				//echo $sql;die;
				$result = mysqli_query($link,$sql);
				//var_dump($result);exit;
				$row = mysqli_fetch_assoc($result);
				//var_dump($row);exit;
$str = <<<aa

					<div id="left">
						<img src="./5.JPG">
					</div>
					<div id="left1">
						<img src="../../../public/uploads/{$row['picname']}" alt=""></a>						
					</div>
					<div id="right">
						<div id="jiage">
							<font><b>5CM {$row['goods']}</b></font><br/>
							<font><b>5CM</b></font><br/>
							<font size="5px" color="#cccccc"><b>市场价： ￥999.00</b></font><br/>
							<font><b size="10px">促销价：</b> <b size="8px">￥{$row['price']}</b></font><br/>
						</div>
					</div>
	

aa;

	echo $str;
				
		?>	
		
				<div id="right1">
					<img src="fnajfnqwqwiorj123.JPG">
				</div>
				<div id="right2">
					<img src="jgtrczcer0fsmwo.JPG">
				</div>
				<div id="right3">
					<font>选颜色：</font><br/>
					<div id="c1"><a href="#">黑色</a></div> <div id="c2"><a href="#">白色</a></div>
					<br/>
					<font>选尺码: </font><br/>
					<div id="s1"><a href="#">S</a></div><div id="s2"><a href="#">M</a></div><div id="s3"><a href="#">L</a></div><div id="s4"><a href="#">XL</a></div><br/>
					<div id="right4">
						选数量:
<head>						
						  <style>
						  * {
						  box-sizing: border-box;
						}

						.input-number {
						  width: 40px;
						  padding: 0 12px;
						  vertical-align: top;
						  text-align: center;
						  outline: none;
						}

						.input-number,
						.input-number-decrement,
						.input-number-increment {
						  border: 1px solid #cccccc;
						  height: 40px;
						  user-select: none;
						}

						.input-number-decrement,
						.input-number-increment {
						  display: inline-block;
						  width: 30px;
						  line-height: 38px;
						  background: #f1f1f1;
						  color: #444444;
						  text-align: center;
						  font-weight: bold;
						  cursor: pointer;
						}
						.input-number-decrement:active,
						.input-number-increment:active {
						  background: #dddddd;
						}

						.input-number-decrement {
						  border-right: none;
						  border-radius: 0px 0 0 0px;
						}

						.input-number-increment {
						  border-left: none;
						  border-radius: 0 0px 0px 0;
						}</style>

						 

</head>

<body>
 
	<span class='jian' style='cursor:pointer;'>[-]</span>
		<input type="text" class='num' name='num' value='1' style='width:20px'>
	<span class='jia' style='cursor:pointer;'>[+]</span><br>

</body>
&nbsp;&nbsp;&nbsp;&nbsp; <?php	//服务器被访问过多少次 
	$num = file_get_contents("a.txt")+0;//0  读取
	echo "浏览量:{$num}次";//0
	$num++;//1
	file_put_contents("a.txt",$num);//1  写入
?>	
				</div>
				</div>	
	<!--------------------这里他喵的是个重点,传值的三种方式--------------------->	
				<div id="check">
					<form action="../shoppingcar/docared.php" method="GET">
						<!----------------这里需要进行固定的传值,详情将信息跳转至购物车----------------------->
						<a href="../shoppingcar/docared.php">
						<input type='hidden' name='id' value="<?php echo $row[id];?>">
						<input type="submit" value="添加到购物车" style="width:219px;height:54px;background:#EA2502;color:white"></a>
						<!--------------------将img换成submit,记得美化----------------------------->
					</form>
				</div>
	<!--------------------FORM表单的三种传值:1.GET-GET;2.POST-POST;3.GET不用GET接收,用?id=<?php $row['id']?>------------------------------->
				<div id="shoucang">
					<a href=""><input type="submit" value="收藏" style="width:143px;height:54px;background:#white;color:black"></a>
				</div>
			</div>
		</div>	
		<div id="content">
			<div id="content1">
				<img src="vxiuiqrazviu.JPG">
			</div>
			<div id="content2">
				<img src="xiangqing2.JPG">
			</div>
			<div id="content4">
				<img src="xiangqing3.JPG">
			</div>
			
			<div id="bottom">
				<a href="lyb/index.php"><img src="pinglun.JPG"></a>
			</div>
		</div>
		<div id="foot">
			<img src="bottomJPG.JPG">
		</div>
	</body>